package xiao.ke.sbdemo.dao;/**
 * @author XuXiaoK
 * @create 2019-12-19 13:41
 */

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import xiao.ke.sbdemo.po.Tag;

import java.util.List;

/**
 *@Author XiaoKe
 *@Date 2019/12/19 13:41
 *@Description TODO
 */
@Repository
public interface TagRepository extends JpaRepository<Tag,Long> {

    Tag findByName(String name);

    @Query("select t from Tag t")
    List<Tag> findTop(Pageable pageable);
}